/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.sack.scratchpad;
/**
 *
 * @author svw
 */
import java.io.File;
import javax.swing.*;
import javax.swing.filechooser.*;

/* txt_file_filter.java is used by FileChooserDemo2.java. */
public class txt_file_filter extends FileFilter {

    
    public boolean accept(File f) {
        if (f.isDirectory()) {
            return true;
        }

        String extension = Utils.getExtension(f);
        if (extension != null) {
            if (extension.equals(Utils.txt)) {
                    return true;
            } else {
                return false;
            }
        }

        return false;
    }

    //The description of this filter
    public String getDescription() {
        return "*.txt";
    }
}
